import java.util.Scanner;

public class Shui_Xian_Hua_Shu {
    //求范围n内的水仙花数
    public static void main(String[] args) {
        System.out.println("请输入范围n");
        Scanner scan=new Scanner(System.in);
       int n=scan.nextInt();
        int a = 0;
        int b = 0;
        int c = 0;
        for (int i = 101; i < n; i++) {
            a = (i/100)%10;
            b = (i / 10) % 10;
            c = i % 10;
            if (Math.pow(a, 3) + Math.pow(b, 3) + Math.pow(c, 3) == i) {
                System.out.println(i);
            }
        }
    }
}

        



